class Hero:
    #初始化英雄的信息
    def __init__(self,hp,power,name):
        self.hp = hp
        self.power = power
        self.name = name
    #进行竞争
    def fight(self,enemy_hp,enemy_power,enemy_name):
        final_power = self.power-enemy_power
        final_hp = self.hp -enemy_hp
        if final_power > 0:
            print(self.name+'赢了')
        elif final_hp < 0:
            print(enemy_name+'赢了')
        else:
            print('达成平手')

jinx = Hero(100,360,'JINX')
EZ = Hero(100,360,'EZ')
jinx.fight(EZ.hp,EZ.power,EZ.name)



